/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package beans;

import java.util.ArrayList;
import java.util.List;
import javax.ejb.Stateful;

/**
 *
 * @author faraz
 */
@Stateful
public class ShoppingCart implements ShoppingCartRemote {

    private List<String> cartItems = new ArrayList<>();
    private List<String> inventoryItems = new ArrayList<>();

    public ShoppingCart() {
        inventoryItems.add("Item 1");
        inventoryItems.add("Item 2");
        inventoryItems.add("Item 3");
        inventoryItems.add("Item 4");
    }

    @Override
    public void addItemToCart(int ID) {
        cartItems.add(inventoryItems.get(ID - 1));
    }

    @Override
    public List<String> getItemsInCart() {
        return cartItems;
    }

    @Override
    public void emptyCart() {
        cartItems.clear();
    }
}
